package com.yz.hw_student.system.service.impl;

import com.yz.hw_student.system.entity.SysRole;
import com.yz.hw_student.system.entity.SysUserRole;
import com.yz.hw_student.system.mapper.SysRoleMapper;
import com.yz.hw_student.system.service.ISysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yz.hw_student.system.service.ISysUserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yz
 * @since 2025-04-02
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {
    @Autowired
    ISysUserRoleService sysUserRoleService;

    @Override
    public void testRoleAdd(SysRole sysRole) {
        this.save(sysRole);
        SysUserRole sysUserRole = new SysUserRole ();
        sysUserRole.setRoleId(sysRole.getRoleId());
        sysUserRole.setRoleId(1);
        sysUserRoleService.save(sysUserRole);
    }
}
